<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 导入 layui 样式 -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <!-- 导入 user-list css -->
    <link rel="stylesheet" href="/assets/css/article/article-list.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">文章列表</div>
        <div class="layui-card-body">
            <form class="layui-form layui-form-pane" id="filter-form" lay-filter="filter-form">
                <!-- 分类 -->
                <div class="layui-form-item layui-input-inline">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-block">
                        <select name="cate_id"></select>
                    </div>
                </div>
                <!-- 状态 -->
                <div class="layui-form-item layui-input-inline">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <select name="state">
                            <option value="">所有状态</option>
                            <option value="已发布">已发布</option>
                            <option value="草稿">草稿</option>
                        </select>
                    </div>
                </div>
                <!-- 筛选 -->
                <div class="layui-form-item layui-input-inline">
                    <button class="layui-btn" lay-submit>筛选</button>
                </div>
                <!-- 重置 -->
                <div class="layui-form-item layui-input-inline">
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </form>
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col width="150">
                    <col width="150">
                    <col width="150">
                    <col width="150">
                </colgroup>
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发表时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
            <div id="pager"></div>
        </div>
    </div>
    <script type="text/html" id="tpl-cate">
        <option value="">所有分类</option>
        {{each data item}}
            <option value="{{item.Id}}">{{item.name}}</option>
        {{/each}}
    </script>
    <script type="text/html" id="tpl-list">
        {{each data item}}
            <tr>
                <td><a data-id="{{item.id}}" href="javascript:void(0);" class="preview-link">{{item.title}}</a></td>
                <td>{{item.cate_name}}</td>
                <td>{{item.pub_date}}</td>
                <td>{{item.state}}</td>
                <td>
                    <button data-id="{{item.id}}" class="layui-btn layui-btn-xs layui-btn-danger btn-delete">删除</button>
                </td>
            </tr>
        {{/each}}
    </script>
    <script type="text/html" id="tpl-preview">
        <h2 class="title"></h2>
        <div class="info">
            作者:{{data.author_id}}
            发布时间:{{data.pub_date}}
            所属分类：{{data.cate_id}}
            状态:{{data.state}}
        </div>
        <div class="article-cover">
            <img src="http://back.zeng.pub/event/{{data.cover_img}}" alt="">
        </div>
        <div class="article-contetn">
            {{@data.content}}
        </div>
    </script>
    <!-- 导入layui js -->
    <script src="/assets/lib/layui/layui.all.js"></script>
    <!-- 导入 jQuery -->
    <script src="/assets/lib/jquery.js"></script>
    <!-- 模板引擎 -->
    <script src="/assets/lib/template-web.js"></script>
    <!-- 导入配置 -->
    <script src="/assets/js/BASE_API.js"></script>
    <!-- 导入 article-list js -->
    <script src="/assets/js/article/article-list.js"></script>
</body>

</html>
